﻿
@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<style>
    .form .formValue input.form-control {
        height: 34px;
        line-height: 34px;        
    }
    .form-control {
        padding:0px;
    }
    .autocomplete-suggestions {
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        border: 1px solid #999;
        background: #FFF;
        cursor: default;
        overflow: auto;
        -webkit-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64);
        -moz-box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64);
        box-shadow: 1px 4px 3px rgba(50, 50, 50, 0.64);
    }
    .autocomplete-selected {
        background: #F0F0F0;
    }
    .autocomplete-suggestion {
        padding: 2px 5px;
        white-space: nowrap;
        overflow: hidden;
    }
    .autocomplete-no-suggestion {
        padding: 2px 5px;
    }
    ul {
        list-style: none;
        float: left;
        -webkit-padding-start: 10px;
    }
    ul li {
        list-style-type:none;
        float:left;
    }
    .active {
        border: 1px solid #1ABC9C;
    }

    .active:hover {
        background-color:#1ABC9C;
        color:#fff;
        text-decoration:none;
    }
    a {
        padding: 3px 10px;        
    }
    a:hover {
        border: 1px solid #1ABC9C;
        text-decoration: none;
    }
    .selectbox {
        color: #444;
        line-height: 34px;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        height: 34px;
        width: 100%;
    }
</style>
<script>
    var keyValue = $.request("keyValue");
    var resultData = {};
    $(function () {
        $("#F_ActivityCityId").select2({ multiple: true });
        
        GetInit();
    });
    function GetInit() {
        resultData = getCache("CLIENT_FORM");
        if (!resultData || resultData.length <= 0) {
            $.ajax({
                url: "/ClientManager/ClientInfos/GetItemListJson",
                dataType: "json",
                async: false,
                success: function (data) {
                    resultData = data;
                    InitControl();
                    setCache("CLIENT_FORM", data);
                }, error: function (XMLHttpRequest, textStatus, errorThrown) {
                }
            });
        } else {
            InitControl();
        }
    }

    function InitControl() {
        var F_ClientType = resultData.F_ClientType;
        for (var i = 0; i < F_ClientType.length; i++) {
            $("#F_ClientType").append("<option value='" + F_ClientType[i].F_ItemCode + "'>" + F_ClientType[i].F_ItemName + "</option>");
        }

        var F_ClientLevel = resultData.F_ClientLevel;
        for (var i = 0; i < F_ClientLevel.length; i++) {
            $("#F_ClientLevel").append("<option value='" + F_ClientLevel[i].F_ItemCode + "'>" + F_ClientLevel[i].F_ItemName + "</option>");
        }

        var F_IndustryId = resultData.F_IndustryId;
        for (var i = 0; i < F_IndustryId.length; i++) {
            $("#F_IndustryId").append("<option value='" + F_IndustryId[i].F_ItemCode + "'>" + F_IndustryId[i].F_ItemName + "</option>");
            $("#F_ZkIndustryId").append("<option value='" + F_IndustryId[i].F_ItemCode + "'>" + F_IndustryId[i].F_ItemName + "</option>");
        }



        var F_DepartmentId = resultData.F_DepartmentId;
        for (var i = 0; i < F_DepartmentId.length; i++) {
            $("#F_DepartmentId").append("<option value='" + F_DepartmentId[i].F_ItemCode + "'>" + F_DepartmentId[i].F_ItemName + "</option>");
        }

        var F_PositionId = resultData.F_PositionId;
        for (var i = 0; i < F_PositionId.length; i++) {
            $("#F_PositionId").append("<option value='" + F_PositionId[i].F_ItemCode + "'>" + F_PositionId[i].F_ItemName + "</option>");
        }

        var F_ActivityType = resultData.F_ActivityType;
        var First_ActivityType = resultData.First_ActivityType;
        var strHtml = "";
        for (var j = 0; j < First_ActivityType.length; j++) {
            strHtml += "<option style=\"font-weight:bold;\" label='" + First_ActivityType[j]["F_ItemName"] +"'>";
            for (var i = 0; i < F_ActivityType.length; i++) {
                if (First_ActivityType[j].F_ItemCode == F_ActivityType[i].F_Description) {
                    strHtml += "<option value='" + F_ActivityType[i].F_ItemCode + "'>" +"&nbsp;&nbsp;&nbsp;&nbsp;"+ F_ActivityType[i].F_ItemName + "</option>";
                }                               
            }
            strHtml += "</option>";            
        }
        $("#F_ActivityType").append(strHtml);
        

        $("#F_ActivityCityId").bindSelect({
            url: "/ClientManager/DemandInfos/GetAllCitys",
            search: true,
            multiple: true,
            id: "F_EnCode",
            text: "F_FullName"
        });  

        var F_SiteType = resultData.F_SiteType;
        for (var i = 0; i < F_SiteType.length; i++) {
            $("#F_SiteType").append("<option value='" + F_SiteType[i].F_ItemCode + "'>" + F_SiteType[i].F_ItemName + "</option>");
        }

        $("#F_CityId").bindSelect({
            url: "/ClientManager/ClientInfos/GetAllCitys",
            search: true,
            id: "F_EnCode",
            text: "F_FullName"
        });       

        var Clients = [];
        var SiteClients = resultData.SiteClients;
        for (var i = 0; i < SiteClients.length; i++) {
            Clients.push({ value: SiteClients[i].F_ClientName, data: SiteClients[i].F_Id });
        }

        $("#F_ClientName").autocomplete({
            lookup: Clients,
            onSelect: function (suggestion) {
                $("#hd_ClientName").val(suggestion.data);
                for (var i = 0; i < resultData.SiteClients.length; i++) {
                    if (suggestion.data == resultData.SiteClients[i].F_Id) {
                        //$("#F_CompanyType").val(resultData.SiteClients[i].F_CompanyType);
                        $("#F_ClientLevel").val(resultData.SiteClients[i].F_ClientLevel);
                        if (resultData.SiteClients[i].F_CityId != null) {
                            $("#F_CityId").val(resultData.SiteClients[i].F_CityId.split(',')).trigger('change');
                            ChangeCityData();
                        }                                                
                        $("#F_Address").val(resultData.SiteClients[i].F_Address);
                        $("#F_IndustryId").val(resultData.SiteClients[i].F_IndustryId);
                    }
                }
                ProjectChange(suggestion.data);
                BrandsChange(suggestion.data);
                ContactsChange(suggestion.data);
            }
        });

        $("#F_MappingId").autocomplete({
            lookup: Clients,
            onSelect: function (suggestion) {
                $("#hd_F_MappingId").val(suggestion.data);
            }
        });
    }

    function ContactsChange(f_fartherId) {
        var contacts = [];
        var sitecontacts = resultData.Contacts;
        for (var i = 0; i < sitecontacts.length; i++) {
            if (sitecontacts[i].F_ClientId == f_fartherId) {
                contacts.push({ value: sitecontacts[i].F_Contact, data: sitecontacts[i].F_Id });
            }
        }
        $("#F_Contact").autocomplete({
            lookup: contacts,
            onSelect: function (suggestion) {
                $("#hd_F_Contact").val(suggestion.data);
                ContactInfo(suggestion.data);
            }
        });
    }

    function ContactInfo(contactId) {
        $.ajax({
            url: "/ClientManager/ClientInfos/GetContactInfo?F_ContactId=" + contactId,
            dataType: "json",
            async: false,
            success: function (data) {
                if (data != null) {
                    $("#F_DepartmentId").val(data["F_DepartmentId"]);
                    $("#F_PositionId").val(data["F_PositionId"]);
                    $("#F_Phone").val(data["F_Phone"]);
                    $("#F_Telephone").val(data["F_Telephone"]);
                    $("#F_Mail").val(data["F_Mail"]);
                    $("input[name='F_Sex'][value=" + data["F_Sex"] + "]").attr("checked", true);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) { }
        });
    }

    function BrandsChange(f_fartherId) {
        var Brands = [];
        var siteBrands = resultData.Brands;
        for (var i = 0; i < siteBrands.length; i++) {
            if (siteBrands[i].F_ClientId == f_fartherId) {
                Brands.push({ value: siteBrands[i].F_BrandName, data: siteBrands[i].F_Id });
            }
        }

        $("#F_BrandId").autocomplete({
            lookup: Brands,
            onSelect: function (suggestion) {
                $("#hd_F_BrandId").val(suggestion.data);
            }
        });
    }

    function ProjectChange(f_fartherId) {
        var Projects = [];
        var siteProjects = resultData.Projects;
        for (var i = 0; i < siteProjects.length; i++) {
            if (siteProjects[i].F_ClientId == f_fartherId) {
                Projects.push({ value: siteProjects[i].F_ProjectName, data: siteProjects[i].F_Id });
            }
        }

        $("#F_ProjectId").autocomplete({
            lookup: Projects,
            onSelect: function (suggestion) {
                $("#hd_F_ProjectId").val(suggestion.data);
            }
        });
    }

    var contracts;
    function ProjectInfo(projectId) {
        $.ajax({
            url: "/ClientManager/ClientInfos/GetProjectInfo?F_Id=" + projectId,
            dataType: "json",
            async: false,
            success: function (data) {
                contracts = data;
                if (data.length > 1) {
                    $("#contactArea").show();
                    $("#contactNum").html(data.length);
                    $("#contractList").empty();
                    for (var i = 0; i < data.length; i++) {
                        if (i == 0) {
                            $("#contractList").append("<li id=" + data[i]["F_Id"] + "><a style=\"cursor:pointer;\" onclick=\"ChangeContract(this)\" class=\"active\">" + data[i]["F_Contact"] + "</a></li>");
                            $("#F_Contact").val(data[i]["F_Contact"]);
                            $("#F_DepartmentId").val(data[i]["F_DepartmentId"]);
                            $("#F_PositionId").val(data[i]["F_PositionId"]);
                            $("#F_Phone").val(data[i]["F_Phone"]);
                            $("#F_Telephone").val(data[i]["F_Telephone"]);
                            $("#F_Mail").val(data[i]["F_Mail"]);
                            $("input[name='F_Sex'][value=" + data[i]["F_Sex"] + "]").attr("checked", true);
                        } else {
                            $("#contractList").append("<li id=" + data[i]["F_Id"] + "><a style=\"cursor:pointer;\" onclick=\"ChangeContract(this)\">" + data[i]["F_Contact"] + "</a></li>");
                        }
                    }
                } else {
                    $("#contactArea").hide();
                    $("#F_Contact").val(data[0]["F_Contact"]);
                    $("#F_DepartmentId").val(data[0]["F_DepartmentId"]);
                    $("#F_PositionId").val(data[0]["F_PositionId"]);
                    $("#F_Phone").val(data[0]["F_Phone"]);
                    $("#F_Telephone").val(data[0]["F_Telephone"]);
                    $("#F_Mail").val(data[0]["F_Mail"]);
                    $("input[name='F_Sex'][value=" + data[0]["F_Sex"] + "]").attr("checked", true);
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) { }
        });
    }

    function ChangeContract(obj) {
        var data = $("#contractList").find("li");
        for (var i = 0; i < data.length; i++) {
            if (data[i].id == obj.parentNode.id) {
                data[i].childNodes[0].className = "active";
                for (var j = 0; j < contracts.length; j++) {
                    if (contracts[j]["F_Id"] == obj.parentNode.id) {
                        $("#F_Contact").val(contracts[j]["F_Contact"]);
                        $("#F_DepartmentId").val(contracts[j]["F_DepartmentId"]);
                        $("#F_PositionId").val(contracts[j]["F_PositionId"]);
                        $("#F_Phone").val(contracts[j]["F_Phone"]);
                        $("#F_Telephone").val(contracts[j]["F_Telephone"]);
                        $("#F_Mail").val(contracts[j]["F_Mail"]);
                        $("input[name='F_Sex'][value=" + contracts[j]["F_Sex"] + "]").attr("checked", true);
                    }
                }
            } else {
                data[i].childNodes[0].className = "";
            }
        }
    }

    function ChangeCityData() {
        var id = $("#F_CityId").val();
        $("#F_AreaId").empty();
        var F_AreaId = resultData.F_AreaId;
        for (var i = 0; i < F_AreaId.length; i++) {
            if (F_AreaId[i].F_ParentId == id) {
                $("#F_AreaId").append("<option value='" + F_AreaId[i].F_EnCode + "'>" + F_AreaId[i].F_FullName + "</option>");
            }
        }
    }

    function submitForm() {
        if (!$('#companyForm').formValid()) {
            return false;
        }
        var F_ClientType = $("#F_ClientType").val();
        var hd_ClientName = $("#hd_ClientName").val();
        var txtF_ClientName = $("#F_ClientName").val();
        var F_ClientName = hd_ClientName == "" ? txtF_ClientName : hd_ClientName;
        var F_CompanyType = "";//$("#F_CompanyType").val();

        var F_ClientLevel = $("#F_ClientLevel").val();
        var F_CityIdList = $("#F_CityId").select2("data");
        var F_CityId = "";
        for (var i = 0; i < F_CityIdList.length; i++) {
            if (i == F_CityIdList.length - 1) {
                F_CityId += F_CityIdList[i].id;
            } else {
                F_CityId += F_CityIdList[i].id + ",";
            }
        }

        var F_AreaId = $("#F_AreaId").val();

        var F_Address = $("#F_Address").val();
        var F_IndustryId = $("#F_IndustryId").val();

        var hd_F_MappingId = $("#hd_F_MappingId").val();
        var txtF_MappingId = $("#F_MappingId").val();
        var F_MappingId = "";
        var F_MappingName = "";
        var F_ZkIndustryId = "";
        var F_ClientType2 = $("#F_ClientType").val();

        if (F_ClientType2 == "1") {
            F_MappingId = F_ClientName;
        } else {
            F_MappingId = hd_F_MappingId;
            F_MappingName = txtF_MappingId;
            F_ZkIndustryId = $("#F_ZkIndustryId").val();
        }

        var F_BrandId = $("#hd_F_BrandId").val();
        var F_BrandName = $("#F_BrandId").val();        

        var F_ProjectId = $("#hd_F_ProjectId").val();
        var F_ProjectName = $("#F_ProjectId").val();       

        var F_ContactId = $("#hd_F_Contact").val();
        var F_Contact = $("#F_Contact").val();
       

        var F_DepartmentId = $("#F_DepartmentId").val();
        var F_PositionId = $("#F_PositionId").val();
        var F_Sex = $("input[name='F_Sex']:checked").val() || "";

        var F_Phone = $("#F_Phone").val();
        var F_Telephone = $("#F_Telephone").val();
        var F_Mail = $("#F_Mail").val();

        var F_ActivityTheme = $("#F_ActivityTheme").val();
        var F_ActivityType = $("#F_ActivityType").val();
        var F_DemandCash = $("#F_DemandCash").val();

        var F_BuildDate = $("#F_BuildDate").val();
        var F_ActivityStartDate = $("#F_ActivityStartDate").val();
        var F_ActivityEndDate = $("#F_ActivityEndDate").val();
        var F_ACityIdList = $("#F_ActivityCityId").select2("data");
        var F_ActivityCityId = "";
        for (var i = 0; i < F_ACityIdList.length; i++) {
            if (i == F_ACityIdList.length - 1) {
                F_ActivityCityId += F_ACityIdList[i].id;
            } else {
                F_ActivityCityId += F_ACityIdList[i].id + ",";
            }
        }

        var F_SiteType = $("#F_SiteType").val();
        var F_SiteArea = $("#F_SiteArea").val();
        var F_Source = $("#F_Source").val();
        var F_PersionNumber = $("#F_PersionNumber").val();
        var F_Height = $("#F_Height").val();
        var F_Note = $("#F_Note").val();

        var param = {
            F_ClientType: F_ClientType,
            F_ClientId: F_ClientName,
            F_ClientLevel: F_ClientLevel,
            F_CityId: F_CityId,
            F_AreaId: F_AreaId,
            F_Address: F_Address,
            F_IndustryId: F_IndustryId,
            F_MappingId: F_MappingId,
            F_MappingName: F_MappingName,
            F_ProjectId: F_ProjectId,
            F_ProjectName: F_ProjectName,
            F_ContactId: F_ContactId,
            F_Contact: F_Contact,
            F_DepartmentId: F_DepartmentId,
            F_PositionId: F_PositionId,
            F_Sex: F_Sex,
            F_Phone: F_Phone,
            F_Telephone: F_Telephone,
            F_Mail: F_Mail,
            F_ActivityTheme: F_ActivityTheme,
            F_ActivityType: F_ActivityType,
            F_DemandCash: F_DemandCash,
            F_ActivityStartDate: F_ActivityStartDate,
            F_ActivityEndDate: F_ActivityEndDate,
            F_ActivityCityId: F_ActivityCityId,
            F_SiteType: F_SiteType,
            F_SiteArea: F_SiteArea,
            F_Source: F_Source,
            F_PersionNumber: F_PersionNumber,
            F_Height: F_Height,
            F_BrandId: F_BrandId,
            F_BrandName: F_BrandName,
            F_Note: F_Note,
            F_BuildDate: F_BuildDate,
            F_ZkIndustryId: F_ZkIndustryId
        };
        $.ajax({
            url: "/ClientManager/ClientInfos/SubmitForm?keyValue=" + keyValue,
            data: param,
            dataType: "json",
            type: 'POST',
            async: false,
            success: function (data) {
                if (data != null) { 
                    $.currentWindow().$("#gridList").trigger("reloadGrid");
                    layer.confirm('需要跳转到销售分配窗口吗？', {
                        btn: ['是', '否']
                    }
                        , function () {
                            if (F_Source == "0" || F_Source == "2" || F_Source == "3" || F_Source == "4") {
                                $.modalOpen({
                                    id: "Share",
                                    title: "分配需求单",
                                    url: "/ClientManager/DemandInfos/Share?F_Id=" + data["F_DemandId"] + "",
                                    width: "1200px",
                                    height: "900px",
                                    callBack: function (iframeId) {
                                        if (top.frames[iframeId].submitForm() != false) {
                                            $.modalFrameClose('clientAdd');
                                        }
                                    }
                                });
                            } else {
                                $.addTab({
                                    href: '/OrderFlowManage/ClientOrder/Details?pageType=all&orderid=' + data["F_OrderId"] + '&type=' + data["F_OrderState"],
                                    text: '需求流转',
                                    id: data["F_Id"],
                                    index: 999
                                });
                                $.modalFrameClose('clientAdd');
                            }
                        }
                        , function () {
                            $.modalFrameClose('clientAdd');
                        }
                    );
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) { }
        });
        //$.submitForm({
        //    url: "/ClientManager/ClientInfos/SubmitForm?keyValue=" + keyValue,
        //    param: param,
        //    success: function () {
        //        $.currentWindow().$("#gridList").trigger("reloadGrid");
        //    }
        //});
    }

    function ChangeClientType() {
        var F_ClientType = $("#F_ClientType").val();
        if (F_ClientType == "1") {
            $("#F_MappingId").attr("disabled", "disabled");
            $("#F_MappingId").css("background-color", "#ddd");
            $("#F_ZkIndustryId").attr("disabled", "disabled");
            $("#F_ZkIndustryId").css("background-color", "#ddd");

            $("#F_IndustryId").removeAttr("disabled");
            $("#F_IndustryId").css("background-color", "#fff");


        } else {
            $("#F_IndustryId").attr("disabled", "disabled");
            $("#F_IndustryId").css("background-color", "#ddd");

            $("#F_MappingId").removeAttr("disabled");
            $("#F_MappingId").css("background-color", "#fff");
            $("#F_ZkIndustryId").removeAttr("disabled");
            $("#F_ZkIndustryId").css("background-color", "#fff");
        }
    }
</script>
    <div id="companyInfos">
        <form id="companyForm">
            <table class="form">
                <tr>
                    <td colspan="6" class="interval">公司基本资料</td>
                </tr>
                <tr>
                    <td colspan="6">
                        <table class="form">
                            <tr>
                                <td class="formTitle">客户类型<span style="color:red;font-weight:bold;font-size:14px;">*</span></td>
                                <td class="formValue">
                                    <select id="F_ClientType" name="F_ClientType" class="form-control required" onchange="ChangeClientType()">
                                        <option value="">==请选择客户类型==</option>
                                    </select>
                                </td>
                                <td class="formTitle">客户名称<span style="color:red;font-weight:bold;font-size:14px;">*</span></td>
                                <td class="formValue">
                                    <div class="input-group" style="width:100%;">
                                        <input type="text" id="F_ClientName" class="form-control required" placeholder="请输入客户名称" />
                                        <span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
                                        <input type="hidden" name="hd_ClientName" id="hd_ClientName" value="" />
                                    </div>
                                </td>                               
                                <td class="formTitle">客户等级</td>
                                <td class="formValue">
                                    <select id="F_ClientLevel" name="F_ClientLevel" class="form-control">
                                        <option value="">==请选择客户等级==</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>                                
                                <td class="formTitle">所在城市</td>
                                <td class="formValue">
                                    <select id="F_CityId" name="F_CityId" class="form-control" onchange="ChangeCityData()">
                                        <option value="">==请选择城市==</option>
                                    </select>
                                </td>
                                <td class="formTitle">行政区域</td>
                                <td class="formValue">
                                    <select id="F_AreaId" name="F_AreaId" class="form-control">
                                        <option value="">==请选择行政区域==</option>
                                    </select>
                                </td>
                                <td class="formTitle">公司地址</td>
                                <td class="formValue">
                                    <input type="text" id="F_Address" name="F_Address" class="form-control" placeholder="请输入公司地址" />
                                </td>
                            </tr>
                            <tr>                                
                                <td class="formTitle">所属行业</td>
                                <td class="formValue">
                                    <select id="F_IndustryId" name="F_IndustryId" class="form-control">
                                        <option value="">==请选择行业==</option>
                                    </select>
                                </td>
                                <td class="formTitle"></td>
                                <td class="formValue"></td>
                            </tr>
                            <tr>
                                <td colspan="6" class="interval">需求信息</td>
                            </tr>
                            <tr>
                                <td colspan="6">
                                    <table class="form">
                                        <tr>
                                            <td class="formTitle">需求来源<span style="color:red;font-weight:bold;font-size:14px;">*</span></td>
                                            <td class="formValue">
                                                <select id="F_Source" name="F_Source" class="form-control required">
                                                    <option value="">==请选择需求来源==</option>
                                                    <option value="0">400电话</option>
                                                    <option value="1">销售自拓</option>
                                                    <option value="2">网站订单</option>
                                                    <option value="3">小程序订单</option>
                                                    <option value="4">App订单</option>
                                                </select>
                                            </td>
                                            <td class="formTitle">所属行业</td>
                                            <td class="formValue">
                                                <select id="F_ZkIndustryId" name="F_ZkIndustryId" class="form-control">
                                                    <option value="">==请选择行业==</option>
                                                </select>
                                            </td>
                                            <td class="formTitle">活动主题<span style="color:red;font-weight:bold;font-size:14px;">*</span></td>
                                            <td class="formValue">
                                                <input type="text" id="F_ActivityTheme" name="F_ActivityTheme" class="form-control required" placeholder="请输入活动主题" />
                                            </td>                                                                                       
                                        </tr>
                                        <tr>
                                            <td class="formTitle">活动类型</td>
                                            <td class="formValue">
                                                <select id="F_ActivityType" name="F_ActivityType" class="form-control select2-container select2-container--default select2-container--open">
                                                    <option value="">==请选择活动类型==</option>
                                                </select>
                                            </td> 
                                            <td class="formTitle">搭建日期</td>
                                            <td class="formValue">
                                                <input type="text" id="F_BuildDate" name="F_BuildDate" class="form-control input-wdatepicker" onfocus="WdatePicker()" placeholder="请输入活动搭建日期" />
                                            </td>
                                            <td class="formTitle">活动开始日期<span style="color:red;font-weight:bold;font-size:14px;">*</span></td>
                                            <td class="formValue">
                                                <input type="text" id="F_ActivityStartDate" name="F_ActivityStartDate" class="form-control input-wdatepicker required" onfocus="WdatePicker()" placeholder="请输入活动开始日期" />
                                            </td>
                                                                                      
                                        </tr>
                                        <tr>
                                            <td class="formTitle">活动结束日期<span style="color:red;font-weight:bold;font-size:14px;">*</span></td>
                                            <td class="formValue">
                                                <input type="text" id="F_ActivityEndDate" name="F_ActivityEndDate" class="form-control input-wdatepicker required" onfocus="WdatePicker()" placeholder="请输入活动结束日期" />
                                            </td>  
                                            <td class="formTitle">预算金额<span style="color:red;font-weight:bold;font-size:14px;">*</span></td>
                                            <td class="formValue">
                                                <input type="text" id="F_DemandCash" name="F_DemandCash" class="form-control required number" placeholder="请输入预算金额" />
                                            </td>
                                            <td class="formTitle">活动城市<span style="color:red;font-weight:bold;font-size:14px;">*</span></td>
                                            <td class="formValue">
                                                <select id="F_ActivityCityId" name="F_ActivityCityId" class="form-control required">                                                   
                                                </select>
                                            </td>                                 
                                        </tr>
                                        <tr>
                                            <td class="formTitle">场地类型<span style="color:red;font-weight:bold;font-size:14px;">*</span></td>
                                            <td class="formValue">
                                                <select id="F_SiteType" name="F_SiteType" class="form-control required">
                                                    <option value="">==请选择场地类型==</option>
                                                </select>
                                            </td>
                                            <td class="formTitle">活动人数</td>
                                            <td class="formValue">
                                                <input type="text" id="F_PersionNumber" name="F_PersionNumber" class="form-control number" placeholder="请输入活动人数" />
                                            </td> 
                                            <td class="formTitle">场地面积(㎡)</td>
                                            <td class="formValue">
                                                <input type="text" id="F_SiteArea" name="F_SiteArea" class="form-control number" placeholder="请输入场地面积" />
                                            </td>                                                                                        
                                        </tr>
                                        <tr>
                                            <td class="formTitle">层高(m)</td>
                                            <td class="formValue">
                                                <input type="text" id="F_Height" name="F_Height" class="form-control number" placeholder="请输入层高" />
                                            </td> 
                                            <td class="formTitle"></td>
                                            <td class="formValue"></td>
                                            <td class="formTitle"></td>
                                            <td class="formValue"></td>
                                        </tr>
                                        <tr>
                                            <td class="formTitle">备注</td>
                                            <td class="formValue" colspan="5">
                                                <textarea rows="3" id="F_Note" name="F_Note" class="form-control" placeholder="请输入备注信息" style="width:99%;"></textarea>
                                            </td>                                            
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" class="interval">品牌项目组信息</td>
                                <td colspan="2" class="interval"><div id="contactArea" style="display:none;float:left;height:35px;line-height:35px;width:100%;"><span style="float:left;">共<em id="contactNum" style="color:red;">0</em>个联系人</span><ul id="contractList"></ul></div></td>
                            </tr>
                            <tr>
                                <td colspan="6">
                                    <table class="form">
                                        <tr>
                                            <td class="formTitle">直客名称</td>
                                            <td class="formValue">
                                                <div class="input-group" style="width:100%;">
                                                    <input type="text" id="F_MappingId" class="form-control" placeholder="请输入直客名称" />
                                                    <span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
                                                    <input type="hidden" name="hd_F_MappingId" id="hd_F_MappingId" value="" />
                                                </div>
                                            </td>                                            
                                            <td class="formTitle">品牌名称</td>
                                            <td class="formValue">
                                                <div class="input-group" style="width:100%;">
                                                    <input type="text" id="F_BrandId" class="form-control" placeholder="请输入品牌名称" />
                                                    <span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
                                                    <input type="hidden" name="hd_F_BrandId" id="hd_F_BrandId" value="" />
                                                </div>
                                            </td>
                                            <td class="formTitle">所属项目组</td>
                                            <td class="formValue">
                                                <div class="input-group" style="width:100%;">
                                                    <input type="text" id="F_ProjectId" class="form-control" placeholder="请输入项目组" />
                                                    <span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
                                                    <input type="hidden" name="hd_F_ProjectId" id="hd_F_ProjectId" value="" />
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>                                            
                                            <td class="formTitle">联系人<span style="color:red;font-weight:bold;font-size:14px;">*</span></td>
                                            <td class="formValue">
                                                <div class="input-group" style="width:100%;">
                                                    <input type="text" id="F_Contact" name="F_Contact" class="form-control required" placeholder="请输入联系人" />
                                                    <span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
                                                    <input type="hidden" name="hd_F_Contact" id="hd_F_Contact" value="" />
                                                </div>
                                            </td>
                                            <td class="formTitle">所属部门</td>
                                            <td class="formValue">
                                                <select id="F_DepartmentId" name="F_DepartmentId" class="form-control">
                                                    <option value="">==请选择部门==</option>
                                                </select>
                                            </td> 
                                            <td class="formTitle">所属职位</td>
                                            <td class="formValue">
                                                <select id="F_PositionId" name="F_PositionId" class="form-control">
                                                    <option value="">==请选择职位==</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="formTitle">性别</td>
                                            <td class="formValue">
                                                <input type="radio" name="F_Sex" value="1" />男<input type="radio" name="F_Sex" value="0" />女
                                            </td>
                                            <td class="formTitle">手机号码<span style="color:red;font-weight:bold;font-size:14px;">*</span></td>
                                            <td class="formValue">
                                                <input type="text" id="F_Phone" name="F_Phone" class="form-control required isMobile" placeholder="请输入手机号" />
                                            </td> 
                                            <td class="formTitle">公司座机</td>
                                            <td class="formValue">
                                                <input type="text" id="F_Telephone" name="F_Telephone" class="form-control isPhone" placeholder="请输入公司座机" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="formTitle">Email</td>
                                            <td class="formValue">
                                                <input type="text" id="F_Mail" name="F_Mail" class="form-control email" placeholder="请输入Email" />
                                            </td>                                            
                                            <td class="formTitle"></td>
                                            <td class="formValue"></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>                             
                        </table>
                    </td>
                </tr>               
            </table>
        </form>        
    </div>  
    


